package online.longzipeng.mywebdemo.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @author lzp
 * @Description: groovy script auto generate
 */
@Data
@TableName("comment")
@AllArgsConstructor
@NoArgsConstructor
public class Comment implements Serializable {

	/**
	 * 自增主键
	 */
	@TableId(value = "id", type = IdType.AUTO)
	@JsonSerialize(using = ToStringSerializer.class)
	private Long id;

	/**
	 * 默认设置为当前时间戳
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@TableField(fill = FieldFill.INSERT)
	private Date createTime;

	/**
	 * 用户的uid
	 */
	private Integer uid;

	/**
	 * 内容
	 */
	private String content;

	/**
	 * 评论对应对象的id
	 */
	private Integer objId;

	/**
	 * 回复的目标用户的uid
	 */
	private Integer toUid;

}
